package thread;

/**
 *
 */
public class ThreadInfoDemo {
    public static void main(String[] args) {
        Thread main = Thread.currentThread();

        String name = main.getName();
        System.out.println(name);

        long id = main.getId();
        System.out.println(id);

        int priority = main.getPriority();
        System.out.println(priority);
        //当前线程是否被中断了
        boolean isInterrupted = main.isInterrupted();
        System.out.println(isInterrupted);
        //是否为守护线程
        boolean isDaemon = main.isDaemon();
        System.out.println(isDaemon);
        //是否活着
        boolean isAlive = main.isAlive();
        System.out.println(isAlive);
    }
}
